#include "random.h"

Random* Random::instance = NULL;

Random::Random()
{
	srand(time(0));
}

void Random::Destroy()
{
	if(instance != NULL)
	{
		delete instance;
		instance = NULL;
	}
}

Random* Random::Instance()
{
    if(instance == NULL)
	{
		instance = new Random();
	}
    return instance;
}

int Random::RandomIntBetween(int min, int max)
{
	return (rand()%(max-min)) + min;
}

float Random::RandomFloatZeroToOne()
{
	return ((float)rand()/(float)RAND_MAX);
}